<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>${fname}</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="./styles/FxOnlineReader.css" />
    <link rel="stylesheet" type="text/css" media="all" href="./styles/jquery.jscrollpane.css" />
    <link rel="stylesheet" type="text/css" href="./styles/dtree.css" />  
    <link rel="stylesheet" type="text/css" href="./styles/dialog.css" />
    <link rel="stylesheet" type="text/css" href="./styles/contextmenu.css" />  
    
    	<script type="text/javascript" src="./Scripts/jquery.min.1.4.2.js"></script>
		<script type="text/javascript" src="./Scripts/tools.js"></script>
		<script type="text/javascript" src="./Scripts/jquery-ui-1.8.18.custom.min.js"></script>		
		<script type="text/javascript" src="./Editor1.0/zip/zip.js"></script>
		<script type="text/javascript" src="./Editor1.0/zip/zip-fs.js"></script>
		<script type="text/javascript" src="./Editor1.0/zip/zip-ext.js"></script>
		<script type="text/javascript" src="./Editor1.0/zip/inflate.js"></script>
		<script type="text/javascript" src="./Editor1.0/zip/deflate.js"></script>
        <script type="text/javascript" src="./Editor1.0/ColorConvertor.js"></script>
		<script type="text/javascript" src="./Editor1.0/PDFunc.js"></script>
		<script type="text/javascript" src="./Editor1.0/ShadingPattern.js"></script>
		<script type="text/javascript" src="./Editor1.0/PDRender_Pattern.js"></script>
		<script type="text/javascript" src="./Editor1.0/PDBookMarkTree.js"></script>
		<script type="text/javascript" src="./Editor1.0/PDForm.js"></script>
		<script type="text/javascript" src="./Editor1.0/TillingPattern.js"></script>
		<script type="text/javascript" src="./Editor1.0/Type3FontInfo.js"></script>
		<script type="text/javascript" src="./Editor1.0/TypeFunction.js"></script>
		<script type="text/javascript" src="./Editor1.0/PDPageObjects.js"></script>
		<script type="text/javascript" src="./Editor1.0/PDRender_Tilling.js"></script>
		<script type="text/javascript" src="./Editor1.0/BinaryReader.js"></script>
		<script type="text/javascript" src="./Editor1.0/FontInfo.js"></script>
		<script type="text/javascript" src="./Editor1.0/softMask.js"></script>
		<script type="text/javascript" src="./Editor1.0/PDStates.js"></script>
		<script type="text/javascript" src="./Editor1.0/PageObj.js"></script>
		<script type="text/javascript" src="./Editor1.0/InlineImgObj.js"></script>
		<script type="text/javascript" src="./Editor1.0/FormObj.js"></script>
		<script type="text/javascript" src="./Editor1.0/TextObj.js"></script>
		<script type="text/javascript" src="./Editor1.0/ImgObj.js"></script>
		<script type="text/javascript" src="./Editor1.0/PathObj.js"></script>
		<script type="text/javascript" src="./Editor1.0/PDAnnot.js"></script>
		<script type="text/javascript" src="./Editor1.0/ShadingObj.js"></script>
		<script type="text/javascript" src="./Editor1.0/Matrix.js"></script>
		<script type="text/javascript" src="./Editor1.0/PDPage.js"></script>
		<script type="text/javascript" src="./Editor1.0/PDInterForm.js"></script>
		<script type="text/javascript" src="./Editor1.0/InterFormFiller.js"></script>
		<script type="text/javascript" src="./Editor1.0/PDDoc.js"></script>
		<script type="text/javascript" src="./Editor1.0/bmpblend.js"></script>
		<script type="text/javascript" src="./Editor1.0/PDRender.js"></script>
		<script type="text/javascript" src="./Editor1.0/ContainerManager.js"></script>
		<script type="text/javascript" src="./Editor1.0/FontLoader.js"></script>
		<script type="text/javascript" src="./Editor1.0/PDBookmark.js"></script>
		<script type="text/javascript" src="./Editor1.0/TextPage.js"></script>
		<script type="text/javascript" src="./Editor1.0/TextInfo.js"></script>
		<script type="text/javascript" src="./Editor1.0/DataMgr.js"></script>
		<script type="text/javascript" src="./Editor1.0/ViewSDK.js"></script>
		<script type="text/javascript" src="./Editor1.0/PageView.js"></script>
		<script id="20" type="text/javascript" src="./Editor1.0/Reader.js"></script>
		<script src="./Scripts/sea.js"  type="text/javascript"></script>
</head>
<body>
    <div id="MainFrame" style='width:100%;height:100%;left:0px;top:0px' class='fwr_main_frame_wnd'>
    	<div style="position: absolute; left: 0px; top: 0px; width: 1366px; display: block;" class="fwr_top_layer_2 fwr_mainfrm_top" id="MainFrame_topPanel"><div class="fwr_ribbon_top_panel" id="MainFrame_topPanel_ribbon"><div class="fwr_ribbon_topbar1" id="MainFrame_topPanel_ribbon_topbar1"><span class="fwr_file_name" id="MainFrame_topPanel_ribbon_topbar1_filename">74cd2edb-c20d-49f6-b929-ae8a043d38d4.pdf</span><span id="MainFrame_topPanel_ribbon_topbar1_brand" class="fwr_ribbon_topbar1_container fwr_ribbon_topbar1_rowleft"><a style="width:16px;height:16px"> <img width="16" height="16" src="images/foxitappicon.png" style="border:none; vertical-align:middle;margin-top:-3px;"> </a><span class="fwr_foxit_brand" id="FoxitPDFWebReaderBrand">Foxit Web Reader</span></span></div><div class="fwr_ribbon_topbar2" id="MainFrame_topPanel_ribbon_topbar2"><span id="MainFrame_topPanel_ribbon_topbar2_dockButtons" class="fwr_ribbon_topbar2_dockbutton fwr_text_upperCase fwr_ribbon_left_toolbar"><a title="Download Original PDF File" class="fwr_toolbar_text_btn fwr_toobar_download_nor fwr_toolbar_btn" id="btnDownload"><span class="fwr_img_24by24 fwr_toolbar_img"><img src="images/downloadfile_nor.png" class="fwr_img_24by24" alt=""></span><span class="fwr_toollabel">Download</span></a><div class="fwr_toolbar_separator"></div><a cmd="HandToolSelect" title="Hand Tool" class="fwr_toolbar_btn fwr_toolbar_text_btn fwr_toobar_handtool_active" id="btnHandToolSelect"><span class="fwr_img_24by24 fwr_toolbar_img"><img cmd="HandToolSelect" src="images/hand_select.png" class="fwr_img_24by24" alt=""></span><span cmd="HandToolSelect" class="fwr_toollabel">Hand</span></a><a cmd="TextToolSelect" title="Text Selection Tool" class="fwr_toolbar_btn fwr_toobar_texttool_dis fwr_toolbar_text_btn" id="btnTextToolSelect"><span class="fwr_img_24by24 fwr_toolbar_img"><img cmd="TextToolSelect" src="images/text_select.png" class="fwr_img_24by24" alt=""></span><span cmd="TextToolSelect" class="fwr_toollabel">Select Text</span></a></span><span id="MainFrame_topPanel_ribbon_topbar2_righttools" class="fwr_ribbon_right_toolbar"><div aria-labelledby="SearchHiddenLabel" class="fwr_search_ui_area fwr_toolbar_btn_margin" id="fwr_search_ui_area"><div style="cursor: text;padding-left: 3px;padding-top: 2px;color: #D7D7D7;display: hidden; position: absolute;" aria-hidden="true" id="SearchHiddenLabel">Search for...</div><div class="fwr_search_box_buttom_frame" id="fwr_search_box_buttom_frame"><span id="FindSplitButton-Small" tabindex="0" title="" class="fwr_search_split_button"><a title="" style="float: left;height:100%" tabindex="-1"><span><span style="float:left;height:100%"><img style="" src="images/search.png" id="fwr_search_icon" alt=""></span></span></a></span><input type="text" maxlength="255" title="" autocomplete="off" class="fwr_search_box" id="textsearch"></div></div><a cmd="SearchPrev" style="" title="Find Previous" class="fwr_toolbar_btn fwr_toolbar_search_btn fwr_toolbar_search_prev_dis" id="btnPrevSearch"></a><a cmd="SearchNext" style="" title="Find Next" class="fwr_toolbar_btn fwr_toolbar_search_btn fwr_toolbar_search_next_dis" id="btnNextSearch"></a><div style="padding-left: 0px;padding-right: 0px;" id="fx_doc_qrcode" class="fwr_toolbar_btn fwr_qrcode_frame fwr_toolbar_btn_margin"><a class="fwr_qrcode"></a></div></span></div></div></div>
    	<div style="position: absolute; left: 0px; top: 54px; height: 534px; width: 222px;" class="fwr_top_layer" id="MainFrame_leftPanel"><div style="height:100%" class="fwr_navigation_bar_tabmenu" id="tabPanel"><ul id="btnList"><li style="height:24px;width:40px" class="fwr_left_panel fwr_left_panel_border_bottom" id="popleft"><div class="fwr_hidden fwr_expand_panel_btn" id="leftpopimg"></div></li><li title="Bookmark" style="cursor:pointer;" id="bmtab" class="fwr_left_panel fwr_left_panel_border_bottom fwr_left_panel_border_right fwr_tab_selected"><img style="width:24px; height:24px;margin-top:8px;" src="./images/bookmark_nor.png"></li><li title="Thumbnails" style="cursor:pointer;" id="thumbtab" class="fwr_left_panel fwr_left_panel_border_bottom fwr_left_panel_border_right"><img style="width:24px; height:24px;margin-top:8px;" src="./images/thumbnail_tab_nor.png"></li></ul></div><div style="position: absolute; overflow: hidden; width: 180px; height: 534px; color: rgb(69, 97, 118); left: 40px;" class="fwr_left_panel_content" id="fxtree_panel"><div style="color:#171717; font-size:14px; height:24px;width:100%" id="biaotou" class="fwr_left_panel fwr_left_panel_border_bottom "><div style="text-align: left;font-size: 13px;"><div id="panelTitle" style="float:left;">Bookmark</div><div class="fwr_hide_panel_btn" style="float:right;" id="lefthid"></div></div></div><div class="jScrollPaneContainer jScrollPaneScrollable" id="fxBookmarkPanel" style="width: 180px; height: 510px; overflow: hidden; padding: 0px;"><div class="jspContainer" style="width: 180px; height: 510px;">
    	<div class="jspPane" style="padding: 0px; top: 0px; width: 180px;"><div class="dtree">
		<div style="display:none" class="dTreeNode"><img nodeid="0" class="bookmarkNode" alt="" src="" id="ibm_0"><a nodeid="0" class="node bookmarkNode"><span nodeid="0" class="bookmarkNode" title="" id="bm_0"></span></a></div></div></div></div></div><div class="fwr_hidden jScrollPaneContainer jScrollPaneScrollable " id="fxThumbView"><div style="height: 100%; width: 0px; overflow: hidden; padding: 0px;" class="fwr_pages" id="fxThumbView_ThumbsViewContainer"><div class="jspContainer" style="width: 0px; height: 0px;">
		<div class="jspPane" style="padding: 14px 0px 0px; top: 0px; width: 0px;"><div style="position: relative; display: inline-block; margin-left: 10px; height: 179px; width: 138px;" class="fwr_display_inline_block fwr_thumb_page" id="fxThumbView_ThumbsViewContainer_ThumbContainer_0"><div page-index="0" style="cursor: pointer;height:149px;width:115.13636363636363px;left:50%;position:absolute;margin-left:-57.56818181818181px;top:50%;margin-top:-84.5px;" class="thumbimage border  fwr_hidden" id="fxThumbView_ThumbsViewContainer_Wrap_0"></div><img page-index="0" style="height:149px;width:115.13636363636363px;left:50%;position:absolute;margin-left:-57.56818181818181px;top:50%;margin-top:-84.5px;;background-size:cover;" class="border  thumbimage fwr_thumb_image_emphasized" id="fxThumbView_ThumbsViewContainer_BG_0" src="GetPageImg.do?fileid=eyJzaWQiOiIyOTNVejI2ejJiNzQiLCJpaWQiOiI3YzNlMGI3OGY5MjE0Yjc3OWM0MTE2YWI1NTg2ZDY0ZSJ9&amp;page=0&amp;zoom=thumb" alt=""><img style="position: absolute; left: 50%; top: 50%; margin-top: -12px; margin-left: -12px; display: none;" src="./images/loading.gif" id="fxThumbView_ThumbsViewContainer_Loader_0"><div style="width:20px;position:absolute;bottom:1px;left:50%;text-align:center;margin-left:-10px" class="fwr_page_number"><span id="fxThumbView_ThumbsViewContainer_PageNum_0" class="fwr_page_number_focus">1</span></div></div></div></div></div></div></div><div title="Click and drag to resize." class="fwr_windows_splitter" style="height: 534px; left: 220px;" id="splitter_navigation_panel"></div><div title="Click and drag to resize." class="fwr_windows_splitter fwr_top_layer" style="height: 534px; position: absolute; left: -10000px;" id="splitter_navigation_panel__move"></div></div>
		<div style="width: 1366px;" class="fwr_top_layer_2 fwr_mainfrm_bottom" id="MainFrame_bottomPanel"><div class="fwr_ribbon_bottom_panel" id="MainFrame_bottomPanel_ribbon"><div class="fwr_ribbon_bottombar" id="MainFrame_bottomPanel_ribbon_bottombar"><span class="fwr_ribbon_bottombar_rowcenter" id="MainFrame_bottomPanel_ribbon_bottombar_center"><a cmd="GoFirstPage" title="First Page" class="fwr_toobar_image_btn fwr_toobar_first_page_nor fwr_toolbar_btn" id="btnfirst"></a><a cmd="GoPrevPage" title="Previous Page" class="fwr_toobar_image_btn fwr_toobar_prev_page_nor fwr_toolbar_btn" id="btnpre"></a><div class="fwr_toolbar_page_control"><input type="text" value="1" class="fwr_text_input fwr_display_inline fwr_toolbar_page_control_pagenum" id="textpagenum"><span class="fwr_label fwr_toolbar_page_control_pagecnt" id="totalPages"> / 1</span></div><a cmd="GoNextPage" title="Next Page" class="fwr_toolbar_btn fwr_toobar_image_btn fwr_toobar_next_page_nor" id="btnnext"></a><a cmd="GoLastPage" title="Last Page" class="fwr_toolbar_btn fwr_toobar_image_btn fwr_toobar_last_page_nor" id="btnlast"></a></span><span id="MainFrame_bottomPanel_ribbon_bottombar_righttools" class="fwr_ribbon_bottombar_rowright"><a cmd="ZoomOut" title="Zoom Out" '="" class="fwr_toolbar_btn fwr_toobar_image_btn fwr_toobar_zoomout_nor" id="btnzoomOut"></a><div style="width:80px;margin-top:9px;" class="fwr_toobar_image_btn ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all" id="zoom_select_slider"><div class="ui-slider-range ui-slider-range-max ui-widget-header" style="width: 66.6667%;"></div></div><a cmd="ZoomIn" title="Zoom In" class="fwr_toolbar_btn fwr_toobar_image_btn fwr_toobar_zoomin_nor" id="btnzoomIn"></a></span></div></div></div>
		<div style="position: relative; width: 1144px; height: 534px; overflow: hidden; padding: 0px; outline: medium none; left: 222px; top: 54px;" class="fwr_pages scroll-pane jspScrollable fwr_hand_cursor" id="MainFrame_ViewContainer" tabindex="0"><div class="jspContainer" style="width: 1144px; height: 534px;overflow: scroll;" id="jspviewarea">
		<div class="jspPane" style="padding: 14px 0px 0px; top: 0px; left: 0px; width: 1122px;">
		<div class="jspPaneTree">
		</div>
		<!--
		<div class="jspVerticalBar"><div class="jspCap jspCapTop"></div><div class="jspTrack" style="height: 534px;"><div class="jspDrag" style="height: 6px; top: 415.647px;"><div class="jspDragTop"></div><div class="jspDragBottom"></div></div></div><div class="jspCap jspCapBottom"></div></div>
		-->
    </div>
    <div>
        <input id="fileid" type="hidden" value="${fileid}"/>
		<input id="fname" type="hidden" value="${fname}"/>
		<input id="qrcode" type="hidden" value="${qrcode}"/>
		<input id="dtype" type="hidden" value="${dtype}"/>
    </div>
</body>
		
<script type="text/javascript">
    var beforeload = (new Date()).getTime();
    function pageloadingtime()  
	{ 
	   //calculate the current time in afterload  
	  var afterload = (new Date()).getTime(); 
	   // now use the beforeload and afterload to calculate the seconds 
	
	  var secondes = (afterload-beforeload)/1000; 
	   // Place the seconds in the innerHTML to show the results 
	  console.log("You Page Load took " + secondes + " seconde(s)."); 
	} 
	function GetHiddenParamValue(key) {
        if (document.getElementById(key))
            return document.getElementById(key).value;
        else
            return null;
    }
    
    var reader = null;
    function unloadAllJS() {
		var jsArray = new Array();
		jsArray = document.getElementsByTagName('script');
			for (i = 0; i < jsArray.length; i++){
				if (jsArray[i].id){
					unloadJS(jsArray[i].id);
				}else{
					jsArray[i].parentNode.removeChild(jsArray[i]);
				}
			}
	}
	function unloadJS(scriptName) {
		var head = document.getElementsByTagName('head').item(0);
		var js = document.getElementById(scriptName);
		console.log(js.id);
		js.parentNode.removeChild(js);
	}
	function InitWebReader(){
		var fileID = GetHiddenParamValue("fileid");
        var fileName = GetHiddenParamValue("fname");
        var language = "en-us";
		var qrcodeUrl = GetHiddenParamValue("qrcode");
        var plugins = 1023;
        var dtype = GetHiddenParamValue("dtype");
        reader = new Reader(fileID,fileName,qrcodeUrl,dtype,"GetDocBin.do","GetPageBin.do",qrcodeUrl);
        var pageCount = reader.CreateDocViewHtml();
		$("#textpagenum").val(1);
		$("#btnnext").bind("click",function(){
		    var currPage = reader.getCurrentPage();
		    var tmp = document.getElementById("MainFrame_ViewContainer_PageContainer_" + (currPage + 1));
        	if(tmp == null){
				var str = "<div style=\"position: relative; height: 1056px; width: 816px; margin-left: 155px;\" id=\"MainFrame_ViewContainer_PageContainer_" + (currPage + 1) + "\" class=\"fwr_page\">";
				$(".jspPaneTree").append(str);
			}
        	reader.goToNextPage(currPage + 1);
        	currPage = reader.getCurrentPage();
        	$("#textpagenum").val(currPage + 1);
		});
		$("#btnpre").bind("click",function(){
			var currPage = reader.getCurrentPage();
			var tmp = document.getElementById("MainFrame_ViewContainer_PageContainer_" + (currPage - 1));
        	if(tmp == null){
				var str = "<div style=\"position: relative; height: 1056px; width: 816px; margin-left: 155px;\" id=\"MainFrame_ViewContainer_PageContainer_" + (currPage -1) + "\" class=\"fwr_page\">";
				$(".jspPaneTree").append(str);
			}
        	reader.goToPreviousPage(currPage - 1);
        	currPage = reader.getCurrentPage();
        	$("#textpagenum").val(currPage + 1);
		});
		
		$("#btnfirst").bind("click",function(){
        	reader.goToFirstPage();
        	var currPage = reader.getCurrentPage();
        	var tmp = document.getElementById("MainFrame_ViewContainer_PageContainer_0");
        	if(tmp == null){
				var str = "<div style=\"position: relative; height: 1056px; width: 816px; margin-left: 155px;\" id=\"MainFrame_ViewContainer_PageContainer_" + 0 + "\" class=\"fwr_page\">";
				$(".jspPaneTree").append(str);
			}
        	$("#textpagenum").val(currPage + 1);
		});
		
		$("#btnlast").bind("click",function(){
			var pageCount = reader.getPageCount();
			var tmp = document.getElementById("MainFrame_ViewContainer_PageContainer_" + (pageCount - 1));
        	if(tmp == null){
				var str = "<div style=\"position: relative; height: 1056px; width: 816px; margin-left: 155px;\" id=\"MainFrame_ViewContainer_PageContainer_" + (pageCount - 1) + "\" class=\"fwr_page\">";
				$(".jspPaneTree").append(str);
			}
        	reader.goToLastPage();
        	var currPage = reader.getCurrentPage();
        	$("#textpagenum").val(currPage + 1);
		});
		
		$("#textpagenum").bind("keypress",function(event){
			if(event.keyCode == "13"){
				var pageCount = reader.getPageCount();
				var index = $("#textpagenum").val();
				var tmp = document.getElementById("MainFrame_ViewContainer_PageContainer_" + (index - 1));
				if(index > 0 && index <= pageCount){
					if(tmp == null){
						var str = "<div style=\"position: relative; height: 1056px; width: 816px; margin-left: 155px;\" id=\"MainFrame_ViewContainer_PageContainer_" + (index -1) + "\" class=\"fwr_page\">";
						$(".jspPaneTree").append(str);
					}
				}
			
			reader.goToPage(index - 1);
			}
		});
		$("#btnzoomOut").bind("click",function(){
        	reader.zoomOut();
		});
		
		$("#btnzoomIn").bind("click",function(){
        	reader.zoomIn();
		});
		
		var afterload = (new Date()).getTime(); 
		//console.log("You Page Load took " + (afterload-beforeload) + " ms"); 
	}
	
    if (document.all) {
        window.attachEvent('onload', function () {
            InitWebReader();
            //unloadAllJS();
        });
    } else {
        window.addEventListener('load', function () {
            InitWebReader();
           // unloadAllJS();
        });
    }
</script>
</html>
